// 开始按钮的亮光
import 'dart:ui';

import 'package:flame/components.dart';
import 'package:flame/events.dart';
import 'package:flutter_flame/config/AssetsName.dart';
import 'package:flutter_flame/component/SpriteEntity.dart';
import 'package:flutter_flame/testFunction/testFunction.dart';
import 'package:flutter_flame/worlds/game/audio/SoundManager.dart';

class SeedChooserButtonGlow extends SpriteEntity with TapCallbacks {
  SeedChooserButtonGlow(this.complete)
      : super(AssetsName.spriteSeedChooserButtonGlow);
  VoidCallback complete;

  @override
  Future<void> onLoad() async {
    await super.onLoad();
    setSize(155.0);
    position = Vector2(-22, -6);
    opacity = 0.7;

    // 【调试】
    TestFunction.autoTapStart(() {
      complete();
    });
  }

  @override
  void onTapDown(TapDownEvent event) {
    SoundManager().choosePlantSeed();
    complete();
    super.onTapDown(event);
  }
}
